﻿//Limite the length of TextBox input string...start


String.prototype.len=function(){  
return this.replace(/[^\x00-\xff]/g,"**").length;  
}  
 
//Set maxlength for multiline TextBox  
function setMaxLength(object,length)  
{ 
     
    var result = true;  
    var controlid = document.selection.createRange().parentElement().id;  
    var controlValue = document.selection.createRange().text;  
    var tempString=object.value; 
     
    var tt="";  
    for(var i=0;i<length;i++)  
        {  
            if(tt.len()<length)  
                tt=tempString.substr(0,i+1);  
            else  
                break;  
        }  
    if(tt.len()>length) 
        tt=tt.substr(0,tt.length-1); 
    object.value=tt; 
     
     
}  
//2009-12-10 add by yvesyu
function setMaxLengthEx(object, length) {
    var result = true;
    var controlid = document.selection.createRange().parentElement().id;
    var controlValue = document.selection.createRange().text;
    if (controlid == object.id && controlValue != "") {
        result = true;
    }
    else if (object.value.len() >= length) {
        result = false;
    }
    if (window.event) {
        if (window.event.keyCode != 8 && !(window.event.keyCode >= 37 && window.event.keyCode <= 40) )
            window.event.returnValue = result;
        else
            window.event.returnValue = true;
        return result;
    }
} 
//Check maxlength for multiline TextBox when paste  
function limitPaste(object,length)  
{  
        var tempLength = 0;  
        if(document.selection)  
        {  
            if(document.selection.createRange().parentElement().id == object.id)  
            {  
                tempLength = document.selection.createRange().text.len();  
            }  
        }  
        var tempValue = window.clipboardData.getData("Text");  
        tempLength = object.value.len() + tempValue.len() - tempLength;  
 
        if (tempLength > length)  
        {  
            tempLength -= length;  
            var tt="";  
            for(var i=0;i<tempValue.len()-tempLength;i++)  
                {  
                    if(tt.len()<(tempValue.len()-tempLength))  
                        tt=tempValue.substr(0,i+1);  
                    else  
                        break;  
                }  
            if(tt.len()<=0) 
            {     
                window.event.returnValue=false; 
                 
            } 
            else 
            { 
                tempValue=tt;  
                window.clipboardData.setData("Text", tempValue);  
                window.event.returnValue = true;  
            } 
        }  
     
 
}  
 
function PressLength() 
{ 
    // Updated by 冯友军，经与Lyrix & Xue确认，将text的限制去掉， 即文本框不做此限制
    // if(event.srcElement.type=="text" || event.srcElement.type=="textarea" )  
    if(event.srcElement.type=="textarea" ) 
    { 
        if(event.srcElement.length!=null) 
            setMaxLength(event.srcElement,event.srcElement.length); 
         
    } 
} 
 
function LimitLength() 
{ 
 
    // Updated by 冯友军，经与Lyrix & Xue确认，将text的限制去掉， 即文本框不做此限制
    // if(event.srcElement.type=="text" || event.srcElement.type=="textarea" ) 
    if( event.srcElement.type=="textarea" ) 
    { 
        if(event.srcElement.length!=null) 
            limitPaste(event.srcElement,event.srcElement.length); 
    } 
} 
document.documentElement.attachEvent('onkeyup', PressLength);  
document.documentElement.attachEvent('onpaste', LimitLength); 


//Limite the length of TextBox input string...end




//Auto Refresh...start

window.status=defaultStatus;

var monitor_time_span;
var stop = false;

function StartAutoRefresh()
{
    document.getElementById ("ctl00_ContentPlaceHolder1_TopToolBar_ilb_AutoRefresh").disabled=true;
    document.getElementById ("ctl00_ContentPlaceHolder1_TopToolBar_ilb_StopRefresh").disabled=false;
    //window.setInterval("DoRefresh();",10000);
    window.setInterval("TimeCompute();",1000);
  
}
 var lastSecond =15;// monitor_time_span;
function TimeCompute()
{ 
    if(!stop)
    {
        //如果当前页面有子页面对话框弹出，则暂时不刷新
        if(document.getElementById("dialogBox")==null || document.getElementById("dialogBox").style.display=="none")
        {
          lastSecond  ++;
         window.status =( 15- lastSecond)+"秒后自动刷新页面" ;
         
         if(lastSecond == 15)
          {
            DoRefresh();
            lastSecond =0;
             stop=false;
             //window.setInterval("TimeCompute();",1000);
             monitor_time_span=0;
          }
         } 
     }
     else
     {
         window.status = "停止刷新";
     }
     
}

function DoRefresh()
{
    if(!stop)
    {
    WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$TopToolBar$ilb_Refresh$ctl01", "", true, "", "", false, true));
    //    __doPostBack('ctl00$ContentPlaceHolder1$TopToolBar$ilb_Refresh$ctl01','');
        
    }
    
}

function StopRefresh()
{
    if(stop == false)
    {
    lastSecond = monitor_time_span;
    stop= true;
    window.status = "停止刷新";
    document.getElementById ("ctl00_ContentPlaceHolder1_TopToolBar_ilb_StopRefresh").disabled=true;
    document.getElementById ("ctl00_ContentPlaceHolder1_TopToolBar_ilb_AutoRefresh").disabled=false;
    
    }
    return false;

}

function StartRefresh()
{
    if(stop == true)
    {
    lastSecond = monitor_time_span;
    stop = false;
    window.status = "";
    document.getElementById ("ctl00_ContentPlaceHolder1_TopToolBar_ilb_AutoRefresh").disabled=true;
    document.getElementById ("ctl00_ContentPlaceHolder1_TopToolBar_ilb_StopRefresh").disabled=false;
    
    }
    return false;
}


//Auto Refresh...end




var auto_close_hand;
var auto_close_hand1;
var auto_close_hand2;
var is_opera_d  = (navigator.userAgent.toLowerCase().indexOf('opera') != -1);
String.prototype.trim = function()
{
	return this.replace(/(^[ |　]*)|([ |　]*$)/g, "");
}
function $(s)
{
	if(document.getElementById)
	{
		return eval('document.getElementById("' + s + '")');
	}
	else
	{
		return eval('document.all.' + s);
	}
}
function $$(s)
{
	return document.frames?document.frames[s]:$(s).contentWindow;
}
function $c(s)
{
	return document.createElement(s);
}
function swap(s,a,b,c)
{
	$(s)[a]=$(s)[a]==b?c:b;
}
function exist(s)
{
	return $(s)!=null;
}
function dw(s)
{
	document.write(s);
}
function hide(s)
{
	$(s).style.display=$(s).style.display=="none"?"":"none";
}
function isNull(_sVal)
{
	return (_sVal == "" || _sVal == null || _sVal == "undefined");
}
function removeNode(s)
{
	if(exist(s))
	{
		$(s).innerHTML = '';
		$(s).removeNode?$(s).removeNode():$(s).parentNode.removeChild($(s));
	}
}

function dialog()
{
	var titile = '';
	var auto = 'y';
	var width = 240;
	var height = 120;
	var src = "";
	
	var path = "../themes/blue/images/frame/";
	var sFunc = '<input id="dialogOk" type="button" value=" 确 定 " onclick="this.disabled=true;new dialog().evalFun();" /><input type="hidden" id="confirmCmd"/><input id="dialogCancel" type="button" value=" 取 消 " onclick="new dialog().reset();" />';
	var sClose = '<input type="image" id="dialogBoxClose" onclick="new dialog().reset();" src="' + path + 'cancel.gif" border="0" width="16" height="16" align="absmiddle" />';
	var sMaxWin ='<input type="image" id="dialogBoxClose" onclick="new dialog().ResizeMax();" src="' + path + 'cancel.gif" border="0" width="16" height="16" />';
	var sBody = '\
		<table id="dialogBodyBox" border="0" align="center" cellpadding="0" cellspacing="6" width="100%">\
			<tr height="10"><td colspan="4"></td></tr>\
			<tr><td colspan="4" align="center">\
			<div id="dialogMsgDiv" style="text-align:center"><div id="dialogMsg" style="font-size:12px;line-height:180%;"></div></div>\
			</td></tr>\
			<tr><td id="dialogFunc" colspan="4" align="center">' + sFunc + '</td></tr>\
			<tr height="5"><td colspan="4" align="center"></td></tr>\
		</table>\
	';
	var sIfram = '\
		<iframe id="dialogIframBG" name="dialogIframBG" frameborder="0" marginheight="0" marginwidth="0" hspace="0" vspace="0" scrolling="no" style="position:absolute;z-index:8;display:none;"></iframe>\
	';

	var sBox = '\
		<div id="dialogBox" style="border:1px solid #1e4775;display:none;z-index:10;width:'+width+'px;">\
		<table width="100%" border="0" cellpadding="0" cellspacing="0">\
			<tr height="24" bgcolor="#8e909c">\
				<td>\
					<table onselectstart="return false;" style="-moz-user-select:none;" width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:#8e909c;  height:25px; border-top:1px solid #92c3ec;">\
						<tr>\
							<td width="6" height="24"></td>\
							<td id="dialogBoxTitle" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="color:#fff;cursor:move;font-size:12px;font-weight:bold;">&nbsp;</td>\
							<td id="dialogClose" width="40" align="right" valign="middle">\
								'+ sClose + '\
							</td>\
							<td width="6"></td>\
						</tr>\
					</table>\
				</td>\
			</tr>\
			<tr id="dialogHeight" style="height:' + height + '" valign="top">\
				<td id="dialogBody" bgcolor="#ffffff">' + sBody + '</td>\
			</tr>\
		</table></div>\
		<div id="dialogBoxShadow" style="display:none;z-index:9;"></div>'+sIfram+'\
	';
	var sBG = '\
		<div id="dialogBoxBG" style="position:absolute;top:50px;left:0px;width:100%;height:100%;"></div>\
	';
	
	this.ResizeMax = function()
	{
	    //将最外层页面的头部和左边全部最小化
	    window.parent.SetVisibility('tblHeader');
	    window.parent.SetVisibility('tdLeft');
	    
	    //最大化当前窗口
	}
	
    this.evalFun = function()
    {
        var executeString=$('confirmCmd').value.replace(/\%20/g,   " ");
        
        eval(executeString);
    }
	this.show = function()
	{
		this.middle('dialogBox');
		
		if ($('dialogIframBG'))
		{
		
			$('dialogIframBG').style.top = $('dialogBox').style.top;
			$('dialogIframBG').style.left = $('dialogBox').style.left;
			$('dialogIframBG').style.width = $('dialogBox').offsetWidth;
			$('dialogIframBG').style.height = $('dialogBox').offsetHeight;
			$('dialogIframBG').style.display = 'block';
			
		}		
		this.shadow();
	}
	
    this.show2 = function()
	{
		this.middle2('dialogBox');
		
		if ($('dialogIframBG'))
		{
		
			$('dialogIframBG').style.top = $('dialogBox').style.top;
			$('dialogIframBG').style.left = $('dialogBox').style.left;
			$('dialogIframBG').style.width = $('dialogBox').offsetWidth;
			$('dialogIframBG').style.height = $('dialogBox').offsetHeight;
			$('dialogIframBG').style.display = 'block';
			
		}		
		this.shadow();
	}
	
	this.show3 = function()
	{
		this.middle3('dialogBox');
		
		if ($('dialogIframBG'))
		{
		
			$('dialogIframBG').style.top = $('dialogBox').style.top;
			$('dialogIframBG').style.left = $('dialogBox').style.left;
			$('dialogIframBG').style.width = $('dialogBox').offsetWidth;
			$('dialogIframBG').style.height = $('dialogBox').offsetHeight;
			$('dialogIframBG').style.display = 'block';
			
		}		
		this.shadow();
	}
	
	this.reset = function()
	{
		this.close();
	}

	this.close = function()
	{
		if ($('dialogIframBG'))
		{
			$('dialogIframBG').style.display = 'none';
		}
		$('dialogBox').style.display='none';
		$('dialogBoxBG').style.display='none';
		$('dialogBoxShadow').style.display = "none";
		$('dialogBody').innerHTML = sBody;
		
		
	}
	this.html = function(_sHtml)
	{
		$("dialogBody").innerHTML = _sHtml;
		this.show();
	}

	this.init = function(big_msg)
	{
		$('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};
		var oDiv = document.createElement('span');
		oDiv.id = "dialogCase";
		if ('yes' == big_msg)
		{
			oDiv.innerHTML = sBG + sBox;
		}
		else
		{
			if (!is_opera_d)
			{
				oDiv.innerHTML = sBG + sIfram + sBox;
			}
			else
			{
				oDiv.innerHTML = sBG + sBox;
			}
		}
		
		document.body.appendChild(oDiv);

		$('dialogBoxBG').style.height = document.body.scrollHeight;
	}

	this.button = function(_sId, _sFuc)
	{
		if($(_sId))
		{
			$(_sId).style.display = '';
			if($(_sId).addEventListener)
			{
				if($(_sId).act)
				{
					$(_sId).removeEventListener('click', function(){eval($(_sId).act)}, false);
				}
				$(_sId).act = _sFuc;
				$(_sId).addEventListener('click', function(){eval(_sFuc)}, false);
			}
			else
			{
				if($(_sId).act)
				{
					$(_sId).dXYchEvent('onclick', function(){eval($(_sId).act)});
				}
				$(_sId).act = _sFuc;
				$(_sId).attachEvent('onclick', function(){eval(_sFuc)});
			}
		}
	}

	this.shadow = function()
	{
		var oShadow = $('dialogBoxShadow');
		var oDialog = $('dialogBox');
		oShadow['style']['position'] = "absolute";
		oShadow['style']['background']	= "#000";
		oShadow['style']['display']	= "";
		oShadow['style']['opacity']	= "0.2";
		oShadow['style']['filter'] = "alpha(opacity=20)";
		oShadow['style']['top'] = oDialog.offsetTop + 6;
		oShadow['style']['left'] = oDialog.offsetLeft + 6;
		oShadow['style']['width'] = oDialog.offsetWidth;
		oShadow['style']['height'] = oDialog.offsetHeight;
	}

	this.open = function(_sUrl, _sMode)
	{
		this.show();
		if(!_sMode || _sMode == "no" || _sMode == "yes"){
			var openIframe = "<iframe width='100%' height='100%' name='iframe_parent' id='iframe_parent' src='" + _sUrl + "' frameborder='0' scrolling='" + _sMode + "'></iframe>";
			$("dialogBody").innerHTML = openIframe;
		}
	}
	
	this.open2 = function(_sUrl, _sMode)
	{
		this.show2();
		if(!_sMode || _sMode == "no" || _sMode == "yes"){
			var openIframe = "<iframe width='100%' height='100%' name='iframe_parent' id='iframe_parent' src='" + _sUrl + "' frameborder='0' scrolling='" + _sMode + "'></iframe>";
			$("dialogBody").innerHTML = openIframe;
		}
	}
	
	this.open3 = function(_sUrl, _sMode)
	{
		this.show3();
		if(!_sMode || _sMode == "no" || _sMode == "yes"){
			var openIframe = "<iframe width='100%' height='100%' name='iframe_parent' id='iframe_parent' src='" + _sUrl + "' frameborder='0' scrolling='" + _sMode + "'></iframe>";
			$("dialogBody").innerHTML = openIframe;
		}
	}

	this.showWindow = function(_sUrl, _iWidth, _iHeight, _sMode)
	{
		var oWindow;
		var sLeft = (screen.width) ? (screen.width - _iWidth)/2 : 0;
		var iTop = -80 + (screen.height - _iHeight)/2;
		iTop = iTop > 0 ? iTop : (screen.height - _iHeight)/2;
		var sTop = (screen.height) ? iTop : 0;
		if(window.showModalDialog && _sMode == "m"){
			oWindow = window.showModalDialog(_sUrl,"","dialogWidth:" + _iWidth + "px;dialogheight:" + _iHeight + "px");
		} else {
			oWindow = window.open(_sUrl, '', 'height=' + _iHeight + ', width=' + _iWidth + ', top=' + sTop + ', left=' + sLeft + ', toolbar=no, menubar=no, scrollbars=' + _sMode + ', resizable=no,location=no, status=no');
			this.reset();
		}
	}

	this.event = function(_sMsg, _sOk, _sCancel, _sClose,evalString)
	{
		$('dialogFunc').innerHTML = sFunc;
		$('dialogClose').innerHTML = sClose;
		$('dialogBodyBox') == null ? $('dialogBody').innerHTML = sBody : function(){};
		if (width > 400 && height > 300)
		{
			$('dialogMsg') ? $('dialogMsg').innerHTML = _sMsg  : function(){};
			$('dialogMsg') ? $('dialogMsg')['style']['fontWeight'] = "bold" : function(){};
			$('dialogMsg') ? $('dialogMsg')['style']['fontSize'] = "15px" : function(){};
			$('dialogMsg') ? $('dialogMsg')['style']['color'] = "#ff9900" : function(){};
			$('dialogMsg') ? $('dialogMsg')['style']['height'] = "150px" : function(){};
		}
		else
		{
			$('dialogMsg') ? $('dialogMsg').innerHTML = _sMsg  : function(){};
		}

		_sOk && _sOk != "" ? this.button('dialogOk', _sOk) : $('dialogOk').style.display = 'none';
		_sCancel && _sCancel != "" ? this.button('dialogCancel', _sCancel) : $('dialogCancel').style.display = 'none';
		_sClose ? this.button('dialogBoxClose', _sClose) : function(){};
        
        $('confirmCmd').value = evalString;
		this.show();
	}
	this.set = function(_oAttr, _sVal)
	{
		var oShadow = $('dialogBoxShadow');
		var oDialog = $('dialogBox');
		var oHeight = $('dialogHeight');

		if(_sVal != '')
		{
			switch(_oAttr)
			{
				case 'title':
					$('dialogBoxTitle').innerHTML = _sVal;
					title = _sVal;
					break;
				case 'width':
					oDialog['style']['width'] = _sVal;
					width = _sVal;
					break;
				case 'height':
					oHeight['style']['height'] = _sVal;
					height = _sVal;
					break;
				case 'src':
					$('dialogMsgDiv').innerHTML = '\
						<table border="0" align="center" cellpadding="0" cellspacing="0" width="100%">\
							<tr>\
								<td width="20%" align="center"><img id="dialogBoxFace" src="' + path + 'login_wrong.gif" /></td>\
								<td id="dialogMsg" style="font-size:12px;line-height:180%;text-align:left;" width="70%"></td>\
							</tr>\
						</table>\
					';
					$('dialogBoxFace') ? $('dialogBoxFace').src = path + _sVal + '.gif' : function(){};
					src = _sVal;
					break;
				case 'auto':
					auto = _sVal;
			}
		}
		this.middle('dialogBox');
		oShadow['style']['top'] = oDialog.offsetTop + 6;
		oShadow['style']['left'] = oDialog.offsetLeft + 6;
		oShadow['style']['width'] = oDialog.offsetWidth;
		oShadow['style']['height'] = oDialog.offsetHeight;
	}

	this.moveStart = function (event, _sId)
	{
		var oObj = $(_sId);
		oObj.onmousemove = mousemove;
		oObj.onmouseup = mouseup;
		oObj.setCapture ? oObj.setCapture() : function(){};
		oEvent = window.event ? window.event : event;
		var dragData = {x : oEvent.clientX, y : oEvent.clientY};
		var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)};
		function mousemove()
		{
			var oEvent = window.event ? window.event : event;
			var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left);
			var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top);
			oObj.style.left = iLeft;
			oObj.style.top = iTop;
			$('dialogBoxShadow').style.left = iLeft + 6;
			$('dialogBoxShadow').style.top = iTop + 6;
			if ($('dialogIframBG'))
			{
				$('dialogIframBG').style.left = iLeft;
				$('dialogIframBG').style.top = iTop;
			}
			dragData = {x: oEvent.clientX, y: oEvent.clientY};

		}
		function mouseup()
		{
			var oEvent = window.event ? window.event : event;
			oObj.onmousemove = null;
			oObj.onmouseup = null;
			if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > document.body.clientWidth || oEvent.clientY > document.body.clientHeight){
				oObj.style.left = backData.y;
				oObj.style.top = backData.x;
				$('dialogBoxShadow').style.left = backData.y + 6;
				$('dialogBoxShadow').style.top = backData.x + 6;
				if ($('dialogIframBG'))
				{
					$('dialogIframBG').style.left = backData.y;
					$('dialogIframBG').style.top = backData.x;
				}
			}
			oObj.releaseCapture ? oObj.releaseCapture() : function(){};
		}
	}

	this.hideModule = function(_sType, _sDisplay)
	{
		var aIframe = parent.document.getElementsByTagName("iframe");
		var aType = document.getElementsByTagName(_sType);
		var iChildObj, iChildLen;
		for (var i = 0; i < aType.length; i++)
		{
			aType[i].style.display	= _sDisplay;
		}
		for (var j = 0; j < aIframe.length; j++)
		{
			iChildObj = document.frames ? document.frames[j] : aIframe[j].contentWindow;
			try
			{
				iChildLen = iChildObj.document.body.getElementsByTagName(_sType).length;
				for (var k = 0; k < iChildLen; k++)
				{
					iChildObj.document.body.getElementsByTagName(_sType)[k].style.display = _sDisplay;
				}
			}
			catch (e){}
		}
	}

	this.middle = function(_sId)
	{
		try
		{
			var aIframe = parent.document.getElementById("iframe_parent");
		}
		catch (e){}
		if (aIframe) {
			var sClientWidth = aIframe.offsetWidth;
			var sClientHeight = aIframe.offsetHeight;
			var sScrollTop = 0;
		} else {
			//var sClientWidth = parent ? parent.document.body.clientWidth : document.body.clientWidth;
			var sClientWidth = screen.width;
			//var sClientHeight = parent ? parent.document.body.clientHeight : document.body.clientHeight;
			var sClientHeight = screen.height;
			var sScrollTop = parent ? parent.document.body.scrollTop : document.body.scrollTop;
			//alert(sClientWidth + '|' + document.body.clientWidth + '|' + screen.width);
			//alert(sClientHeight + '|' + document.body.clientHeight););
		}
		var sleft = (sClientWidth / 2) - ($(_sId).offsetWidth/2) - 75;  // hacked for the concern on left menu
		var iTop = -120 + (sClientHeight / 2 + sScrollTop) - ($(_sId).offsetHeight/2);  // hacked for the concern on top menu
		var sTop = iTop > 0 ? iTop : (sClientHeight / 2 + sScrollTop) - ($(_sId).offsetHeight/2);
		$(_sId)['style']['display'] = '';
		$(_sId)['style']['position'] = "absolute";
		$(_sId)['style']['left'] = sleft;
		$(_sId)['style']['top'] = sTop;
	}
	
	this.middle2 = function(_sId)
	{
		try
		{
			var aIframe = parent.document.getElementById("frmMain");
		}
		catch (e){}
		if (aIframe) {
			var sClientWidth = aIframe.offsetWidth;
			var sClientHeight = aIframe.contentWindow.document.documentElement.clientHeight;
			var sScrollTop = aIframe.contentWindow.document.documentElement.scrollTop;
		} else {
			var sClientWidth = screen.width;
			var sClientHeight = screen.height;
			var sScrollTop = parent ? parent.document.body.scrollTop : document.body.scrollTop;
		}
		var sleft = (sClientWidth / 2) - ($(_sId).offsetWidth/2) - 75;  // hacked for the concern on left menu
		var sTop = sScrollTop + sClientHeight/2 - ($(_sId).offsetHeight/2);
		$(_sId)['style']['display'] = '';
		$(_sId)['style']['position'] = "absolute";
		$(_sId)['style']['left'] = sleft;
		$(_sId)['style']['top'] = sTop;
	}
	
	this.middle3 = function(_sId)
	{
		try
		{
			var aIframe = parent.document.getElementById("iframe_parent");
		}
		catch (e){}
		if (aIframe) {
			var sClientWidth = aIframe.offsetWidth;
			var sClientHeight = aIframe.offsetHeight;
			var sScrollTop = 0;
		} else {
			var sClientWidth = parent ? parent.document.body.clientWidth : document.body.clientWidth;
			//var sClientWidth = screen.width;
			var sClientHeight = parent ? parent.document.body.clientHeight : document.body.clientHeight;
			//var sClientHeight = screen.height;
			var sScrollTop = parent ? parent.document.body.scrollTop : document.body.scrollTop;
			//alert(sClientWidth + '|' + document.body.clientWidth + '|' + screen.width);
			//alert(sClientHeight + '|' + document.body.clientHeight););
		}
		var sleft = 0;//(sClientWidth / 2) - ($(_sId).offsetWidth/2) - 75;  // hacked for the concern on left menu
		var iTop = -120 + (sClientHeight / 2 + sScrollTop) - ($(_sId).offsetHeight/2);  // hacked for the concern on top menu
		var sTop = iTop > 0 ? iTop : (sClientHeight / 2 + sScrollTop) - ($(_sId).offsetHeight/2);
		$(_sId)['style']['display'] = '';
		$(_sId)['style']['position'] = "absolute";
		$(_sId)['style']['left'] = sleft;
		$(_sId)['style']['width'] = sClientWidth-180;
		$(_sId)['style']['height'] = 500;
		$(_sId)['style']['top'] = 0;
	}
	
}
function _error_msg_show(msg, click, icon, title)
{
    click = click ? click : ' ';
    icon = icon ? icon : '';
    title = title ? title : '网页对话框';
    dg=new dialog();
    dg.init();
    dg.set('src', get_icon(icon));
    dg.set('title', title);
    dg.event(msg, click, '', click);
}
///功能：页面上是否已选择了checkbox
///参数：提示信息
///返回值：true表示至少选择了一个，false表示没有选择。
function CheckBoxSeletedInForm(messageInfo)
{
	var elements = document.forms(0).elements;
	var i;
	var obj;
	var msgInfo;
	//var checked;
	
	for(i=0;i<elements.length;i++)
	{
		obj = elements(i);
		
		//当前元素是复选框，并且ID含有check
		if(obj.type.toUpperCase()=="CHECKBOX" && obj.id.indexOf("check")>=0 && obj.id.indexOf("checkall") == -1)
		{
			if(obj.checked) 
				return true;			
		}
	}
	
	if(arguments.length!=0)
	{
		msgInfo=messageInfo;
	}
	else
	{
		msgInfo=CHECKBOX_SELETEDINFORM_MSG;
	}
	alert(msgInfo);
	return false;
}

function SetVisibility(objID)
{
    var obj = document.getElementById(objID);
   if(obj==null) return false; 
   
   if(obj.style.display!="none")
   {
        obj.style.display = "none";    
   } 
   else
   {
        obj.style.display = "block";
   }  
        
    return false;
}

function SetClientElementVisible(objID,visible)
{
    var obj = document.getElementById(objID);
   if(obj==null) return false; 
    
   if(visible)
   {
        obj.style.display="block";
   } 
   else
   {
        obj.style.display="none";
   }
}

function ShowConfirmDialog(evalString)
{ 
    _confirm_msg_show('继续提交?',true,true,'',200,100,'new dialog().close();'+evalString); 
    return false;
}

function _confirm_msg_show(msg, click_ok, click_no, title, width, height,evalString)
{
    evalString = evalString.replace('javascript:','');   
    click_ok = click_ok ? click_ok : ' ';
    click_no = click_no ? click_no : ' ';
    title = title ? title : '网页对话框';

    //检查是否已经选中复选框
    if(!CheckBoxSeletedInForm("请先选择待操作的记录。")) return false;
    dg=new dialog();
    dg.init();
    dg.set('src', get_icon(''));
    dg.set('title', title);
	if (width)
    {
        dg.set('width', width);
    }
    if (height)
    {
        dg.set('height', height);
    }
    dg.event(msg, click_ok, click_no, click_no,evalString);
	$("dialogOk").value="确认提交";
	$("dialogCancel").value="取消";
    return false;	
}

function _confirm_msg_show_NoCheckBox(msg, click_ok, click_no, title, width, height,evalString)
{
    evalString = evalString.replace('javascript:','');   
    click_ok = click_ok ? click_ok : ' ';
    click_no = click_no ? click_no : ' ';
    title = title ? title : '网页对话框';

//    //检查是否已经选中复选框
//    if(!CheckBoxSeletedInForm("请先选择待操作的记录。")) return false;
    dg=new dialog();
    dg.init();
    dg.set('src', get_icon(''));
    dg.set('title', title);
	if (width)
    {
        dg.set('width', width);
    }
    if (height)
    {
        dg.set('height', height);
    }
    dg.event(msg, click_ok, click_no, click_no,evalString);
	$("dialogOk").value="确认提交";
	$("dialogCancel").value="取消";
    return false;	
}

function ShowConfirm(msg,evalString)
{
   
   try
   {
        evalString = evalString.replace('javascript:','');   
        click_ok = true;
        click_no = true;
        title =  '请确认';

        dg=new dialog();
        dg.init();
        dg.set('src', get_icon(''));
        dg.set('title', title);
	    dg.set('width', 200);
        dg.set('height', 100);
        
        dg.event(msg, click_ok, click_no, click_no,evalString);
	    $("dialogOk").value="确认";
	    $("dialogCancel").value="取消";
	    return false;
	}
	catch(exception)
	{
        return false;	
    }
}

function _set_id_focus(idname)
{
	if (idname != "")
	{
		try {$(idname).focus();}catch (e){}
	}
}

function get_icon(icons)
{
	var icon = 'attention';
	return icon;
}

function openWindow(_sUrl, _sWidth, _sHeight, _sTitle, _sScroll)
{
   try
   {
  // window.open(_sUrl,"123","Width:400px;Height:400px");
      window.showModelessDialog(_sUrl, window, 'dialogWidth:400px;dialogHeight:400px;edge:sunken');

//	var oEdit = new dialog();
//	oEdit.init('yes');
//	oEdit.set('title', _sTitle ? _sTitle : "系统提示信息" );
//	oEdit.set('width', _sWidth);
//	oEdit.set('height', _sHeight);
//	if(_sWidth<750)
//	{
//	    oEdit.set('width', 750);//统一设置所有弹出页面的宽度和高度
//	}
//	if(_sHeight<400)
//	{
//	    oEdit.set('height', 400);
//	}
//	oEdit.set('auto', 'n');
//	oEdit.open(_sUrl, _sScroll != "yes" ? 'no' : 'yes');
	}
	finally
	{
	 return false; 
	 }
}






function getFrameNode(sNode){
	return document.frames ? document.frames[sNode] : document.getElementById(sNode).contentWindow;
}
function zsxz(ta, zs, maxl)
{
	if(ta.value.length > maxl)
	{
		ta.value = ta.value.substring(0,maxl);
	}
	else
	{
		zs.value = maxl - ta.value.length;
	}
}
function strLen(key){
	var l=escape(key),len
	len=l.length-(l.length-l.replace(/\%u/g,"u").length)*4
	l=l.replace(/\%u/g,"uu")
	len=len-(l.length-l.replace(/\%/g,"").length)*2
	return len
}
//处理浏览器，用来选择不同的XML读取函数
var agt = navigator.userAgent.toLowerCase();
var is_opera = (agt.indexOf("opera") != -1);
var is_ie = (agt.indexOf("msie") != -1) && document.all && !is_opera;
var is_ie5 = (agt.indexOf("msie 5") != -1) && document.all;
var uniqnum_counter = (new Date).getTime();
var is_regexp = (window.RegExp) ? true : false;
var xmlhttp = null;

function UniqueNum() {  
	++uniqnum_counter;  
	return uniqnum_counter;
}
//创建Get请求
function StartGETRequest(url, handler)
{
	xmlhttp = null;
	if (is_ie) {    
		var control = (is_ie5) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP";
		try {      
			xmlhttp = new ActiveXObject(control);
		} catch(e) {
			alert("You need to enable active scripting and activeX controls");
			DumpException(e);
		}
	} else {
		xmlhttp = new XMLHttpRequest();
	}
	xmlhttp.onreadystatechange = function() {handler();}
	if (url.indexOf("?") != -1){
		var urltemp = url + "&rand=" + UniqueNum();
	} else {
		var urltemp = url + "?rand=" + UniqueNum();
	}
	//alert(urltemp);
	xmlhttp.open('GET', urltemp, true);
	
	xmlhttp.send(null);	
}
//创建POST请求
function StartPOSTRequest(url, data, handler)
{
	xmlhttp = null;
	if (is_ie) {    
		var control = (is_ie5) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP";
		try {      
			xmlhttp = new ActiveXObject(control);
		} catch(e) {
			alert("You need to enable active scripting and activeX controls");
			DumpException(e);
		}
	} else {
		xmlhttp = new XMLHttpRequest();
	}
	xmlhttp.onreadystatechange = function() {handler();}
	xmlhttp.open('POST', url, true);
	if (typeof(xmlhttp.setRequestHeader) != "undefined") {
		xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; Charset=GB2312');
	}
	xmlhttp.send(data);	
}
//处理方法
function GetObjValue(objName)
{
	if(document.getElementById){
		return eval('document.getElementById("' + objName + '")');
	}else{
		return eval('document.all.' + objName);
	}
}
function fetchObject(idname)
{
	if (document.getElementById) {
		return document.getElementById(idname);
	} else if (document.all) {
		return document.all[idname];
	} else if (document.layers) {
		return document.layers[idname];
	} else {
		return null;
	}
}
// function to emulate document.getElementsByTagName
function fetchTags(parentobj, tag)
{
	if (typeof parentobj.getElementsByTagName != 'undefined') {
		return parentobj.getElementsByTagName(tag);
	} else if (parentobj.all && parentobj.all.tags) {
		return parentobj.all.tags(tag);
	} else {
		return null;
	}
}
function fetchXmlValue(parentobj, tag)
{
	try{
		var tags = fetchTags(parentobj, tag);
		return tags[0].firstChild.nodeValue;
	} catch(e) {
		return null;
	}
}
function checkpic(this_form)
{	
	var fso,f; 
	if (this_form.upload_file.value.length > 0){
		var filesize = 1;  
		try {
			fso=new ActiveXObject("Scripting.FileSystemObject");  
   			f = fso.GetFile(this_form.upload_file.value); filesize = f.size;
		} catch (e1) {}
		if (filesize >200000 || filesize == 0) {
			_error_msg_show("文件不能为空，并且小于200K");
			return false;
		}
	}
	return true;
}

function showSending() 
{
	document.getElementById("sending").style.visibility="visible";
	document.getElementById("cover").style.visibility="visible";
}

function on(tdbg)
{
	tdbg.style.background="#fff17d";
}

function off(tdbg)
{
	tdbg.style.background="#EFF7FE";
}

function checkLogin()
{
if (document.login.U_Loginname.value=="")
{
_error_msg_show("会员名不能为空，请输入会员名！");
document.login.U_Loginname.focus();
return false;
}
if (document.login.U_Pass.value=="")
{
_error_msg_show("密码不能为空，请输入密码！");
document.login.U_Pass.focus();
return false;
}
return true;
}function getCommentHtmlList(qid, aid)
{
	var strText;
	var fError = false;
	if (xmlhttp.readyState == 4){
		if (xmlhttp.status == 200){			
			strText = fetchXmlValue(xmlhttp.responseXML, 'body');
			if (null == strText) {
				fError = true;
			} else {
				fetchObject("commentsec" + qid + aid).innerHTML = strText;
			}
		}else{
			fError = true;
		}
	}

	if (fError) {
		fetchObject("commentsec" + qid + aid).innerHTML = "";			
		fetchObject("comment" + qid + aid).style.display = "none";
	} else {
		fetchObject("comment" + qid + aid).scrollIntoView(true);
	}
}

function submitComment(qid, aid)
{
	var strText;
	var fnServerError = DisplayPostCommentError(qid, aid);
	if (xmlhttp.readyState == 4){
		if (xmlhttp.status == 200){
			var res = fetchXmlValue(xmlhttp.responseXML, 'result');
			strText = fetchXmlValue(xmlhttp.responseXML, 'body');
			if (null == strText) {
				fnServerError();
			} else {
				if (res.toLowerCase() == 'ok') {				
					fetchObject("commentsec" + qid + aid).innerHTML = strText;
					var t_total = fetchXmlValue(xmlhttp.responseXML, 'total');
					if (t_total > 0)
					{
						fetchObject("commenttotal" + qid + aid).innerHTML = "评论<b>"+t_total+"</b><img id=\"commentimg"+qid+aid+"\" src=\"http://image2.sina.com.cn/pfp/ask/images/zhishi/dXYil/img2_jj.gif\" border=\"0\" hspace=\"3\">";
					}
					else
					{
						fetchObject("commenttotal" + qid + aid).innerHTML = "评论";
					}					
				} else {
					fetchObject("Err" + qid + aid).innerHTML = "<table cellspacing=3 class='bvError'><tr><td width=15 valign=top><img src='http://image2.sina.com.cn/pfp/ask/images/zhishi/error_icon.gif' width=15 height=16 border=0></td><td height=20 width=100%>"+ strText +"</td></tr></table>";
				}
			}
		}else{
			fnServerError();
		}
	}
}
function OpenSection(qid, aid, pages)
{
	var sectionTitleObj = fetchObject("comment" + qid + aid);
	if (pages >= 0)
	{
	}
	else
	{
		if (sectionTitleObj.style.display == "block")
		{
			Close(qid, aid, pages);
			return ;
		}
	}
	if (sectionTitleObj.style.display == 'none' || sectionTitleObj.style.display == '') {
		sectionTitleObj.style.display = "block";
		try{
			fetchObject("commentimg" + qid + aid).src = "http://image2.sina.com.cn/pfp/ask/images/zhishi/dXYil/img2_jj.gif";
		}catch(e){};
	}
	
	if (pages >= 0) {
		var strA = "questionid="+ qid;
		strA += "&answerid=" + aid;
		strA += "&pages=" + pages;
		StartGETRequest('/browse/zhishi_request_comment_new.php?'+strA, function() {getCommentHtmlList(qid, aid)});
	} else {		
		if(fetchObject("commentsec" + qid + aid).innerHTML == "") {
			var strA = "questionid="+ qid;
			strA += "&answerid=" + aid;
			StartGETRequest('/browse/zhishi_request_comment_new.php?'+strA, function() {getCommentHtmlList(qid, aid)});
		} 
	}
}

function Close(qid, aid, pages)
{
	fetchObject("comment" + qid + aid).style.display = "none";
	try{
		fetchObject("commentimg" + qid + aid).src = "http://image2.sina.com.cn/pfp/ask/images/zhishi/dXYil/img2_jh.gif";
	}catch(e){};
	if (pages > 0) {
		fetchObject("commentsec" + qid + aid).innerHTML = "";
	}
}

function CloseComment(qid, aid)
{
	if (fetchObject("err"+ qid + aid) != null) {
		fetchObject("Err"+qid + aid).innerHTML = "";
		fetchObject("txtComment"+qid + aid).value = "";
	}
	Close(qid, aid);
}

function DisplayPostCommentError(qid, aid)
{
	return function(){
		document.getElementById("Err"+qid+aid).innerHTML = "<table cellspacing=3 class='bvError'><tr><td width=15 valign=top><img src='http://image2.sina.com.cn/pfp/ask/images/zhishi/error_icon.gif' width=15 height=16 border=0></td><td height=20 width=100%>服务器出现问题。请重试。</td></tr></table>";
	}
}

function PostComment(qid, aid)
{
	var strComment = fetchObject("txtComment"+qid + aid);
	var strError = "";
	nCommentLength = strComment.value.length;
	if (nCommentLength == 0 || nCommentLength > 200 ) {
		if (strError.length == 0) {
			strComment.focus();
		}
	}
	if (nCommentLength == 0) {
		strError += "<tr><td width=15><img src='http://image2.sina.com.cn/pfp/ask/images/zhishi/error_icon.gif' width=15 height=16 border=0></td><td height=20 width=100%>评论不能为空。请输入评论，然后单击“发表评论”。</td></tr>";
	} else if (nCommentLength > 200) {
		strError += "<tr><td width=15><img src='http://image2.sina.com.cn/pfp/ask/images/zhishi/error_icon.gif' width=15 height=16 border=0></td><td height=20 width=100%>您输入的评论太长。请缩短您的评论，然后单击“确定”。</td></tr>";
	}
	if (strError.length > 0)
	{
		document.getElementById("Err" + qid + aid).innerHTML = "<table cellspacing=0 border=0 class='bvError'>" + strError + "</table>";
		return false;
	}
	if (window.RegExp && window.encodeURIComponent) {
		var newStrComment = encodeURIComponent(strComment.value);
	} else {
		var newStrComment = strComment.value;
	}

	var strA = "questionid="+ qid;
	strA += "&answerid=" + aid;
	strA += "&do=add";
	strA += "&answer_flag=5";
	strA += "&txtcomment="+newStrComment;
	StartGETRequest('/browse/zhishi_request_comment_new.php?'+strA, function() {submitComment(qid, aid)});
}
<!--
var st1,st2,st3,st4;
function showDiv()
{
	ktdq.style.display = "block";
	st1 = window.setTimeout("hideDiv()",3000);
}
function hideDiv()
{
	ktdq.style.display = "none";
	window.clearTimeout(st1);
}

function showDiv2()
{
	show_div();
	st2 = window.setTimeout("hideDiv2()",12000);
}

function hideDiv2()
{
	showdown();
	window.clearTimeout(st2);
}

function showup()
{
	if(wrong.filters.Alpha.opacity < 100){
		wrong.filters.Alpha.opacity += 10;
		st3 = setTimeout('showup()',100);
	}
}
function showdown()
{
	if(wrong.filters.Alpha.opacity > 50){
		wrong.filters.Alpha.opacity -= 10;
		st4 = setTimeout('showdown()',100);
	}
	else
	{
		wrong.style.display = "none";
		wrong.filters.Alpha.opacity = 50;
	}
}
function show_div()
{
	window.clearTimeout(st3);
	window.clearTimeout(st4);

	wrong.style.display = "block";
	showup();
}
function iask_submit(fn,strName)
{
	if(strName == "ask")
	{
		fn.action = "http://iask.sina.com.cn/question/ask_new_2.php";
		fn.title.value = fn.key.value;
		fn.key.value = '';
		fn.submit();
		return false;
	}
	else if(strName == "know")
	{
		if(fn.key.value == "" || fn.key.value == "请输入查询词" || fn.key.value == "请输入问题标题")
		{
			fn.key.value = "请输入查询词";
			fn.key.focus();
			return false;
		}
		fn.action = "http://iask.sina.com.cn/search_engine/search_knowledge_engine.php";
		fn.submit();
		return false;
	}
	else
	{
		return false;
	}
}

function ckwords(obj)
{
	if(obj.value == "请输入查询词" || obj.value == "请输入问题标题")
	{
		obj.value = "";
		obj.focus();
		return false;
	}
}
function $(_sId)
{
	return document.getElementById(_sId);
}
function hide(_sId){
	$(_sId).style.display = $(_sId).style.display == "none" ? "" : "none";
}
function swapPic(_sId,_sAttr,_sTxt1, _sTxt2) {
	$(_sId)[_sAttr] = $(_sId)[_sAttr].indexOf(_sTxt1) > -1 ? _sTxt2 : _sTxt1;
}
function switchShow(){
	hide('left');
	swapPic('arrow','src','http://image2.sina.com.cn/pfp/ask/images/zhishi/control_switch_up.gif','http://image2.sina.com.cn/pfp/ask/images/zhishi/control_switch_down.gif');
}
//-->

function CheckItem(objID)
{
    if($(objID)!=null)
   {
        var obj = $(objID);
        if(obj.checked)
            obj.parentElement.parentElement.className="SelectedRow";
        else
            obj.parentElement.parentElement.className = "Row";
   } 
}

//add by yvesyu 2009-12-08 返回选择多个项
function CountChecked() 
{ 
    var elements = document.forms(0).elements;
	var i;
	var selCount=0;
	var obj;
	var msgInfo;
	//var checked;
	
	for(i=0;i<elements.length;i++)
	{
		obj = elements(i);
		
		//当前元素是复选框，并且ID含有check
		if(obj.type.toUpperCase()=="CHECKBOX" && obj.id.indexOf("check")>=0 && obj.id.indexOf("checkall") == -1)
		{
			if(obj.checked) 
				selCount++;
		}
	}
	
	return selCount;
} 
//add by yvesyu 2009-12-08 控制只选择一项
function SXYllChecked(obj) 
{ 
    if(obj.id.indexOf("checkall") >=0)
      return;
    
    var cbChecked = obj.checked;
    
    if(!cbChecked)
      return;
    
    if(obj.parentElement.tagName.toUpperCase() == "TH")
    {
        //获取所有的Input元素 
        var allInputObject=obj.parentElement.parentElement.parentElement.getElementsByTagName("input"); 
        for(var i=0; i<allInputObject.length; i++) 
        {        
            //获取input元素中的checkbox 
            if(allInputObject[i].type=="checkbox" && allInputObject[i].parentElement.tagName.toUpperCase() != "SPAN" && allInputObject[i].id!=obj.id ) 
            { 
               allInputObject[i].checked = false;   
               allInputObject[i].parentElement.parentElement.className = "Row";
            } 
        } 
        
        //控制本身的check
        obj.checked = cbChecked;
    }
    else  //为了兼容以前其它可能使用的地方
    {   
        //获取所有的Input元素 
        var allInputObject=document.body.getElementsByTagName("input"); 
        for(var i=0; i<allInputObject.length; i++) 
        { 
            //获取input元素中的checkbox 
            if(allInputObject[i].type=="checkbox" && allInputObject[i].id!=obj.id) 
            { 
               allInputObject[i].checked = false;
               allInputObject[i].parentElement.parentElement.className = "Row";
            } 
        } 
    }
} 
//function CheckAll(obj) 
//        { 
//        
//            var cbChecked = obj.checked;
//            
//            var checkBoxArray=new Array(); 
//            //获取所有的Input元素 
//            var allInputObject=document.body.getElementsByTagName("input"); 
//            for(var i=0; i<allInputObject.length; i++) 
//            { 
//                //获取input元素中的checkbox 
//                if(allInputObject[i].type=="checkbox") 
//                { 
//                   //allInputObject[i].checked = allInputObject[i].checked?false:true;
//                   allInputObject[i].click();
//                  //if(!allInputObject[i].checked) 
//                  //{
//                      allInputObject[i].checked = cbChecked;
//                   //}
//                } 
//            } 
//            
//            //控制本身的check
//            obj.checked = cbChecked;
//        } 

/// Update By 冯友军
/// BUG ID 233：为了解决当选择check all时影响其它的checkbox控件
/// 20080321
function CheckAll(obj) 
        { 
        
            var cbChecked = obj.checked;
            
            if(obj.parentElement.tagName.toUpperCase() == "TH")
            {
                //获取所有的Input元素 
                var allInputObject=obj.parentElement.parentElement.parentElement.getElementsByTagName("input"); 
                for(var i=0; i<allInputObject.length; i++) 
                {        
                    //获取input元素中的checkbox 
                    if(allInputObject[i].type=="checkbox" && allInputObject[i].parentElement.tagName.toUpperCase() != "SPAN") 
                    { 
                       allInputObject[i].click();
                       allInputObject[i].checked = cbChecked;                      
                    } 
                } 
                
                //控制本身的check
                obj.checked = cbChecked;
            }
            else  //为了兼容以前其它可能使用的地方
            {   
                //获取所有的Input元素 
                var allInputObject=document.body.getElementsByTagName("input"); 
                for(var i=0; i<allInputObject.length; i++) 
                { 
                    //获取input元素中的checkbox 
                    if(allInputObject[i].type=="checkbox") 
                    { 
                       allInputObject[i].click();
                       allInputObject[i].checked = cbChecked;
                    } 
                } 
                
                //控制本身的check
                obj.checked = cbChecked;
            }
        } 
function EnterKeyPostBack(postBackCtrlID)
{
    
     if (event.keyCode == 13 && $(postBackCtrlID))
    {
            event.returnValue=false;
            event.cancel = true; 
            var postBackLbStr= $(postBackCtrlID).href.replace('javascript:','');   
            postBackLbStr = postBackLbStr.replace(/\%20/g,   " ");
           // alert(postBackLbStr);
            eval(postBackLbStr);
   }
}

function SetFocus(ctrlID)
{
   //alert("invoked");
   if($(ctrlID))
   {
   
      $(ctrlID).focus();
   }
}
function Base_PostBack(postBackCtrlID)
{
    if($(postBackCtrlID))
   {
            var postBackLbStr= $(postBackCtrlID).href.replace('javascript:','');   
            postBackLbStr = postBackLbStr.replace(/\%20/g,   " ");

            eval(postBackLbStr);
   } 
}

function CloseVirtualWindow()
{
   new dialog().reset();
}

function ShowProcessBar()
{
    if( document.getElementById('divProcessBar') && document.getElementById('processIframBG')) 
    {
        document.getElementById('processIframBG').style.display='block'; 
        document.getElementById('divProcessBar').style.display='block';
    }
}

function ExecuteJS(jsStr)
{
   jsStr = jsStr.replace("$",";");
    if(jsStr=="") return true;
    eval(jsStr);
   return true; 
}